<%@page contentType="text/plain" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
{
    "pages" : [
    <c:forEach var="pageInfo" items="${pages}" varStatus="st1">
        {
            "page": ${pageInfo.pageNumber},
            "recipes": [
            <c:forEach var="recipe" items="${pageInfo.elements}" varStatus="st2">
                {
                    "id": ${recipe.id},
                    "name": "<c:out value="${recipe.name}"/>"
                }<c:if test="${!st2.last}">,</c:if>
            </c:forEach>
            ]
        }<c:if test="${!st1.last}">,</c:if>
    </c:forEach>
    ],
    "totalPagesCount" : ${totalPageCount}
}